﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DanhMucMau8.aspx.cs" Inherits="AIC_CD.DanhMucMau8"
    MasterPageFile="~/Site1.Master" EnableEventValidation="false" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">
    <div id="Div1" class="FormTitle" runat="server">
        <p class="TextTitle">
            <label id="lblFormName" runat="server" class="lblFormName">
            </label>
            <asp:ImageButton CssClass="btnExit" ID="ImageButton1" runat="server" ImageUrl="Images/exit.png"
                Height="24px" OnClick="ImageButton1_Click" />
        </p>
    </div>
    <div class="FormMain">
        <div class="Form Search">
            Nhập tiêu chí tìm kiếm:
            <asp:TextBox ID="txtSearch" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
            <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" CssClass="cmdBtn" OnClick="btnSearch_Click" />
        </div>
        <div class="Form Update" runat="server" id="formUpdate">
            <table border="1px" class="ListTable">
                <tr>
                    <td>
                        Số thứ tự
                    </td>
                    <td>
                        <asp:Label ID="lblSTT" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td style="width: 20%">
                        Tên danh mục
                    </td>
                    <td style="width: 78%">
                        <FCKeditorV2:FCKeditor ID="txtTenDanhMuc" runat="server" Height="200" ToolbarStartExpanded="false">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
                <tr>
                    <td>
                        Đề mục
                    </td>
                    <td>
                        <asp:ScriptManager ID="ScriptManager1" runat="server">
                        </asp:ScriptManager>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:CheckBox ID="chkDeMuc" Text="Không đánh số thứ tự" runat="server" AutoPostBack="True"
                                    OnCheckedChanged="chkDeMuc_CheckedChanged" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:Button ID="btnLuu" runat="server" Text="Lưu lại" CssClass="cmdBtn" OnClick="btnLuu_Click" />
                        <asp:Button ID="btnHuy" runat="server" Text="Hủy" CssClass="cmdBtn" OnClick="btnHuy_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="Form View">
            <asp:Button ID="btnThem" runat="server" Text="Thêm mới" CssClass="cmdBtn" OnClick="btnThem_Click" />
            <asp:GridView ID="grdDanhMuc" runat="server" AutoGenerateColumns="False" CssClass="ListTable"
                DataKeyNames="ID" OnRowCommand="grdDanhMuc_RowCommand">
                <Columns>
                    <asp:BoundField HeaderText="STT" DataField="STT" />
                    <asp:TemplateField HeaderText="Tên danh mục">
                        <ItemTemplate>
                            <asp:Label ID="lblTenDM" runat="server" Text='<%# Eval("TenDM") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày tạo">
                        <ItemTemplate>
                            <asp:Label ID="lblNgayTao" runat="server" Text='<%# Eval("CreateDate") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày cập nhật">
                        <ItemTemplate>
                            <asp:Label ID="lblNgayCapNhat" runat="server" Text='<%# Eval("UpdateDate") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Người cập nhật cuối">
                        <ItemTemplate>
                            <asp:Label ID="kbkNguoiCapNhat" runat="server" Text='<%# Eval("HoTen") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Sửa">
                        <ItemTemplate>
                            <asp:ImageButton ID="lbtEdit" runat="server" ImageUrl="images/edit.gif" CommandName="<%# AIC_CD.MyConst.Action.Update %>"
                                CommandArgument='<%# Eval("ID") %>'></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa">
                        <ItemTemplate>
                            <asp:ImageButton ID="lbtDelete" runat="server" ImageUrl="images/delete.png" CommandName="<%# AIC_CD.MyConst.Action.Delete %>"
                                OnClientClick="return confirm('Bạn có chắc là muốn xóa bản ghi này không ?')"
                                CommandArgument='<%# Eval("ID") %>'></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
